local skynet = require "skynet"

local persistentd 
local M = {}

-- call by agent
function M.load_user_data(uid)
    local user_info = skynet.call(persistentd, "lua", "load_user_data", uid)
    return user_info 
end 

-- call by agent
function M.save_user_data(uid, userinfo)
    skynet.call(persistentd, "lua", "save_user_data", uid, userinfo)
end 

local function init()
    persistentd  = skynet.uniqueservice("persistent")
end 

skynet.init(init)

return M